Skip to content

Fix broker validation of minimal workflow-run repository responses - #10

Merged
AppSolves merged 1 commit into
mainfrom
fix/workflow-run-repository-validation
Nov 14, 2026
Merged

AppSolves merged 1 commit into
mainfrom
fix/workflow-run-repository-validation

Conversation

@AppSolves

@AppSolves AppSolves commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

The Actions workflow-run response embeds a minimal repository without default_branch. Comparing that missing field with the stored default branch rejected valid broker requests before prepare, failure reporting and publication. The fixture incorrectly reused a full repository response and concealed the mismatch.

Fetch authoritative repository metadata once in the shared privileged broker validation and require its repository ID, owner ID and current default branch to match the snapshot. Remove only the invalid embedded-default-branch comparison. Signed OIDC caller/default-ref/immutable workflow binding, protected caller SHA, installation, run event/path/head/attempt, App actor and exact dispatch-title checks remain intact. Every broker operation uses the same validation; no missing-field fallback is introduced.

The shared Actions fixture now omits default_branch. With that realistic shape the baseline end-to-end test reproduced 403 instead of 200 before the fix. Positive coverage includes prepare, failure, result, stage, rotate, release and native publication. Negative coverage checks default-branch drift, repository/owner IDs, run event/path/head/attempt, human/foreign-App actors and each dispatch-title identity across all seven operations; signed wrong-branch/workflow claims and unprotected/stale callers still fail.

Validation passed: npm run check (132 tests, strict typecheck, lint and build), npm run test:clean, and actual workerd/D1 integration tests. No production state was reset, credentials changed or additional reviews triggered.

A backend-only Worker bundle deployment after approval is sufficient. Keep the trusted reusable workflow pin exactly 4ed6688; no caller, Cloudflare config, D1 migration or OAuth reconnect change is required. Do not merge/deploy automatically. After approval/deployment, verify using a fresh owner-authorized review request, including native GitHub review publication; local mocks are not proof of a successful production review.

Additional verification: 38/38 targeted worker/OIDC/security/store tests and the Wrangler bundle dry-run passed. Both full CI runs passed on 04a8b30: push, pull request. Production review/publication acceptance remains pending the separately approved backend deployment and a fresh authorized request.

@AppSolves
AppSolves merged commit 393a434 into main Nov 14, 2026
4 checks passed
@AppSolves
AppSolves deleted the fix/workflow-run-repository-validation branch November 14, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant